New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tickless implementation 2 #5031
Conversation
Alternative to #4991 |
|
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
+1 for if kernel can sleep. What is the preference between those 2 implementations ? as both of them are currently opened. |
#4991 is the preference since this one requires an extension to the RTX API. |
Result: ABORTEDYour command has finished executing! Here's what you wrote!
|
Add support for tickless by replacing RTX's SysTick timer code with with code which uses an mbed timer along with suspending and resuming the kernel in the idle loop. Tickless is enabled on a per-target basis by defining the macro MBED_TICKLESS.
Some Cortex-M0 devices, such as the nrf51, don't have the SysTick. Instead, these targets use a software interrupt to simulate SysTick. Add the hooks in the tickless code to support these devices. Targets which do not have SysTick should now define NO_SYSTICK in targets.json and implement mbed_get_m0_tick_irqn to add os suport. This patch also removes os tick handling from the existing devices (nrf51) since this is now handled in common code.
Decrease the interrupt stack from 2k down to 1k so there is enough ram to build all the tests with tickless enabled. In general, targets should not need an interrupt stack greater than 1k with mbed-os.
Enable tickless on nrf5x devices and the NCS36510.
Add the function osKernelCanSleep which indicates if it is safe to call sleep (while the kernel is suspended). This patch also replaces the svcRtx* calls with os* calls since they no longer need to be called from a critical section.
Closing this out to remove some of the clutter |
This patch is another implementation of tickless which preserves interrupt latency by adding the additional cmsis_os2 function osKernelCanSleep() along with moving code out of the critical section.